package com.quxian.chambercommerce.dao.impl;

import java.util.List;
import java.util.Map;

import com.quxian.chambercommerce.base.BaseDaoSupport;
import com.quxian.chambercommerce.bean.AuthorityEntity;
import com.quxian.chambercommerce.bean.StaffAuthEntity;
import com.quxian.chambercommerce.dao.StaffAuthDao;

public class StaffAuthDaoImpl extends BaseDaoSupport implements StaffAuthDao{

	@SuppressWarnings("unchecked")
	@Override
	public List<StaffAuthEntity> getAuthByStaffId(Integer id) {
		return this.getSqlMapClientTemplate().queryForList("StaffAuth.getAuthByStaffId", id);
	}

	@Override
	public void deleteAuth(Map<String, Object> map) {
		this.getSqlMapClientTemplate().delete("StaffAuth.deleteAuth", map);	
	}

	@Override
	public void addAuth(StaffAuthEntity entity) {
		this.getSqlMapClientTemplate().insert("StaffAuth.addAuth", entity);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<AuthorityEntity> getAllAuth() {
		return this.getSqlMapClientTemplate().queryForList("StaffAuth.getAllAuth");
	}
}
